import List from "./_list";
import style from "./index.module.scss";
import Header from "@/app/components/Header";
import { getFanwen } from "@/service/oldResume";
import Pager from "@/app/components/Pager";
import Footer from "@/app/components/Footer";
import RightContent from "@/app/components/RightContent";

export default async function Home({ params }) {
  const { page } = params;
  const res = await getFanwen({
    pageNum: page || 1,
    pageSize: 10,
  });
  let list = [];
  if (res.code === 200) {
    list = res.data.data;
  }
  return (
    <>
      <Header current="fanwen" style={{ background: "#fff" }} />
      <main className={style.main}>
        <div className={style.container}>
          <div className={style.left}>
            <List list={list} />
            <div style={{ overflow: "hidden" }}>
              <Pager
                style={{ float: "right" }}
                listLen={10 || 0}
                total={res?.data?.total || 0}
                baseUrl="fanwen"
                page={+page}
              ></Pager>
            </div>
          </div>
          <div className={style.right}>
            <RightContent fromList={true} />
          </div>
        </div>
        <Footer />
      </main>
    </>
  );
}
